<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Article>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%--   <div style="display: block; margin-left: 5px;" class="dna-ui-sitemap">
        <%:Ajax.Crumb((new CategoryNodeProvider()), Model.Category.ID.ToString(),Model.Title)%>
    </div>--%>
    <% Ajax.EnabledCustomization(); %>
    <% 
        var siblings = (IEnumerable<Article>)ViewData["Articles"];
        if (!Model.CategoryReference.IsLoaded)
            Model.CategoryReference.Load();%>
    <table style="width: 100%;">
        <tr>
            <td colspan="2" align="right" style="padding-right: 10px;">
                <%:Ajax.ImageToggleButton(new ImageToggleButtonOptions() 
                                                        { 
                                                            ImageUrl=Url.Content("~/Content/Images/sidebar_close.gif"),
                                                            ToggleImageUrl=Url.Content("~/Content/Images/sidebar_open.gif"),
                                                            Text = Html.Global("publishing", "HideSidebar"),
                                                            ToggleText = Html.Global("publishing", "ShowSidebar"),
                                                            OnClientClick = "$('#readerSidebar').fadeOut('normal');",
                                                            OnClientToggleClick = "$('#readerSidebar').fadeIn('normal');",
                                                            ImageStyleText="float:right;margin-left:5px;padding-top:2px;",
                                                            TextStyleText="float:right;"
                                                        })
                %>
            </td>
        </tr>
        <tr>
            <td valign="top">
                <% Html.RenderPartial("ViewContent", Model); %>
                <% if (!string.IsNullOrEmpty(Model.SendTrackbackUrls))
                   {
                       if (Model.GetSendTrackbackUrls().Count == 1)
                       { 
                %>
                <div style="margin-left: 5px; overflow: auto; padding: 5px 5px 5px 0;">
                    <img src="<%:Url.Content("~/Content/Images/reference.gif") %>" alt="References" style="float: left;
                        margin-right: 5px;" />
                    <span style="float: left; margin-right: 5px;">References:</span><a href="<%:Model.SendTrackbackUrls%>"
                        target="_blank">
                        <%:Model.SendTrackbackUrls%></a></div>
                <%}
                       else
                       { %>
                <div style="margin-left: 5px; overflow: auto; padding: 5px 5px 5px 0;">
                    <img src="<%:Url.Content("~/Content/Images/reference.gif") %>" alt="References" style="float: left;
                        margin-right: 5px;" />
                    <span style="float: left;">References:</span></div>
                <blockquote style="clear: left;">
                    <ul class="ui-helper-reset">
                        <% var quoteUrls = Model.GetSendTrackbackUrls();
                           foreach (var quoteUrl in quoteUrls)
                           {
                        %>
                        <li><a href="<%:quoteUrl.ToString() %>" target="_blank">
                            <%:quoteUrl.ToString()%></a></li>
                        <%}%>
                    </ul>
                </blockquote>
                <%}
                   }%>
                <div style="margin-left: 5px; overflow: auto; padding: 5px 5px 5px 0;">
                    <img src="<%:Url.Content("~/Content/Images/Permalink.gif") %>" alt="Permalink" style="float: left;
                        margin-right: 5px;" />
                    <span style="float: left;"><b style="margin-right: 5px;"><%:Html.Global("publishing","PermalinkUrl")%>:</b><%:Model.GetPermaLinkUrl()%></span><span
                        style="clear: left;"></span>
                </div>
                <% if (Model.AllowPingback)
                   { %>
                <div style="margin-left: 5px; overflow: auto; padding: 5px 5px 5px 0;">
                    <img src="<%:Url.Content("~/Content/Images/trackback.gif") %>" alt="Trackback" style="float: left;
                        margin-right: 5px;" />
                    <span style="float: left;"><b style="margin-right: 5px;"><%:Html.Global("publishing","TrackbackUrl") %>:</b><%:Model.GetTrackbackUrl() %></span><span
                        style="clear: left;"></span>
                </div>
                <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"
                    xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
                    <rdf:description rdf:about="<%:Model.GetPermaLinkUrl() %>" dc:identifier="<%:Model.GetPermaLinkUrl() %>"
                        dc:title="<%:Model.Title %>" trackback:ping="<%: Model.GetTrackbackUrl()%>" />
                </rdf:rdf>
                <%} %>
                <% var prevArt = Model.GetPreviousSibling();
                   var nextArt = Model.GetNextSibling();
                %>
                <table width="100%" cellpadding="0" style="padding: 5px 0px 5px 0px; border: none;
                    background: none;" class="ui-state-highlight">
                    <tr>
                        <td style="width: 50%">
                            <% if (prevArt != null)
                               { %>
                            <div>
                                <a href="<%:prevArt.GetPermaLinkUrl() %>"><span style="float: left" class="ui-icon ui-icon-triangle-1-w">
                                </span><span style="float: left; font-weight: bold;"><%:Html.Global("publishing","PreviousPost")%>:
                                    <%:prevArt.GetGlobalizationContent().Title %></span></a></div>
                            <div style="clear: left;">
                            </div>
                            <%} %>
                        </td>
                        <td align="right">
                            <% if (nextArt != null)
                               { %>
                            <div>
                                <a href="<%:nextArt.GetPermaLinkUrl() %>"><span style="float: right" class="ui-icon ui-icon-triangle-1-e">
                                </span><span style="float: right; font-weight: bold;">
                                    <%:nextArt.GetGlobalizationContent().Title%>:<%:Html.Global("publishing","NextPost")%></span> </a>
                            </div>
                            <div style="clear: right;">
                            </div>
                            <%} %>
                        </td>
                    </tr>
                </table>
                <%
                    if (!string.IsNullOrEmpty(WebSite.Open().MasterTools.AddThisCode))
                    { %>
                <div style="min-width: 200px; height: 25px; margin-top: 7px;">
                    <%:MvcHtmlString.Create(WebSite.Open().MasterTools.AddThisCode)%>
                </div>
                <%} %>
                <% if (!string.IsNullOrEmpty(Model.RelatedPosts))
                   {
                       var relatedCollection = Model.GetRelatedArticles();
                %>
                <div style="margin-left: 5px; overflow: auto; padding: 5px 5px 5px 0;">
                    <b>Related articles:</b></div>
                <% foreach (var ra in relatedCollection)
                   { %>
                <div style="clear: left; padding:5px;">
                    <%:Html.ImageLink(ra.Title,ra.GetPermaLinkUrl(),Url.Content("~/Content/Images/relatedpost.gif")) %>
                </div>
                <%} %>
                <%} %>
                <%  
                    if (Model.AllowComments)
                    {
                %>
                <div id="commentlist">
                    <% Html.RenderPartial("Comments", Model); %>
                </div>
                <%} %>
            </td>
            <td valign="top" style="width: 250px;" id="readerSidebar">
                <div class="ui-widget-zone" id="RightZone" style="float: left; min-width: 200px;
                    max-width: 250px">
                    <%-- if (WebContext.Current.Web.IsRoot)
                       { %>
                    <% Ajax.RenderWidget(new Guid("8BDBC511-B149-4AA1-9111-5547DC3FD8B0"), "CategoryNav", "Category", "DNA.Mvc", "RightZone", 0, new { IsDeletable = false });%>
                    <% Ajax.RenderWidget(new Guid("AFA03E50-9A26-441B-8D4F-EC89D0E47D26"), "TagCloud", "Article", "DNA.Mvc", "RightZone", 1, new { IsDeletable = false }); %>
                    <% Ajax.RenderWidget(new Guid("7E137644-6165-43D7-80E6-5BD2EA99E874"), "HeadLines", "Article", "DNA.Mvc", "RightZone", 2, new { IsDeletable = false, Title = "Newest articles", TextLen = 28, ShowAuthor = false, ShowDate = false }); %>
                    <% Ajax.RenderWidget(new Guid("B3DB81A8-BB55-4604-B871-84F9684CCF9E"), "HotReads", "Article", "DNA.Mvc", "RightZone", 3, new { IsDeletable = false, Title = "Top reads" }); %>
                    <% Ajax.RenderWidget(new Guid("C7504B1E-F5DB-4C3C-B817-BB1AD7038C1A"), "MyActions", "Article", "DNA.Mvc", "RightZone", 4, new { IsDeletable = false, Title = "Actions" }); %>
                    <%}
                       else
                       { %>
                    <% Ajax.RenderWidget(new Guid("79945367-1058-410F-B3F1-D523EDC18BB7"), "CategoryNav", "Category", "DNA.Mvc", "RightZone", 0, new { IsDeletable = false });%>
                    <% Ajax.RenderWidget(new Guid("C3D1F4A4-8B7D-4F0D-B52A-EC802205B52B"), "Archives", "Article", "DNA.Mvc", "RightZone", 1, new { IsDeletable = false, CategoryID = WebSite.CurrentWeb().DefaultCategory().ID }); %>
                    <% Ajax.RenderWidget(new Guid("20FE6804-32C9-474B-B095-16E6AC59B32D"), "TagCloud", "Article", "DNA.Mvc", "RightZone", 2, new { IsDeletable = false, Title = "Tags" }); %>
                    <% Ajax.RenderWidget(new Guid("923FAC7F-3A5D-4ED7-832D-E98D1CDD33A7"), "RecentBlogPost", "Article", "DNA.Mvc", "RightZone", 3, new { IsDeletable = false, Title = "Recent posts", TextLen = 28, ShowAuthor = false, ShowDate = false }); %>
                    <% Ajax.RenderWidget(new Guid("EBFC2486-8AFC-46D7-A384-9C2389517DF2"), "MyActions", "Article", "DNA.Mvc", "RightZone", 4, new { IsDeletable = false, Title = "Actions" }); %>
                    <%} --%>
                </div>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <% 
        if (Model.AllowComments)
        {
    %>
    <%:Html.ScriptRefs("jquery.validate.min.js", "MicrosoftMvcJQueryValidation.js")%>
    <link rel="alternate" type="application/rss+xml" href="<%:Url.Action("RssFeed", "Article", new
                       {
                           Area = "Publishing",
                           website = WebContext.Current.Web.Name,
                           id = Model.ID
                       }) %>" title="<%:Model.Title+" Comments Feed" %>" />
    <link rel="alternate" type="application/atom+xml" href="<%:Url.Action("AtomFeed", "Article", new
                       {
                           Area = "Publishing",
                           website = WebContext.Current.Web.Name,
                           id = Model.ID
                       }) %>" title="<%:Model.Title+" Comments Feed" %>" />
    <%} %>
    <% if (Model.AllowPingback)
       { %>
    <link href="<%:WebSite.Open().GetFullUrl()+Url.Content("~/xmlrpc.ping") %>" rel="pingback" />
    <%} %>
</asp:Content>
